<template name="partnerHome">
	<div class="list-block media-list">
		{{#with partner}}
		<div class="item-link item-content">
			<div class="item-media"><img class="x7-myCompany-circleImg" src="{{head_image.path}}" width="60" height="60"></div>
			<div class="item-inner x7-partnerHome-inner">
				<a href="/partnerCenter">
					<div class="item-title-row">
						<div class="item-title">{{real_name}}{{name_postfix}}</div>
					</div>
				</a>
				<div class="item-text">{{school_name}}{{college_name}}{{major_name}}{{grade}}级{{class}}班</div>
			</div>
		</div>
		{{/with}}
	</div>
	<div class="x7-partnerHome-content">
		<div class="x7-partnerHome-subcontent">我的余额（元）：{{wallets.last_money}}</div>
		<a href="/withdrawals" id="withdrawal" class="button active x7-partnerHome-button" style="margin-top: 20px;">提现</a>
	</div>

	<div class="contacts-content">
		<div class="list-block contacts-block">
			<div class="list-group">
				<div class="x7-partnerHome-subtitle">
					<span class="x7-partnerHome-left">我的团队</span>
					{{#with partner}}
					<a href="/myTeam?id={{id}}&level_name={{level_name}}" class="x7-partnerHome-right">查看更多</a>
					{{/with}}
				</div>
				
					{{#if isMonitor}}
					<div class="list-block media-list">
						<ul>
							{{#each my_team}}	
				    			<li>
				      			<a href="#" name="{{_id}}" class="item-link item-content">
				        				<div class="item-inner">
				          				<div class="item-title-row" style="background-image:none !important">
				            					<div class="item-title" style="width: 60%;">{{name}}</div>
				          				</div>
				          				<div class="item-text">{{college_name}}{{major_name}}{{grade}}级{{class}}班</div>
				        				</div>
				     			 </a>
				    			</li>
				    			{{/each}}
				    		</ul>
				    		</div>
						{{else}}
						<div class="x7-partnerHome-title">
							<ul>
							{{#each item in my_team}}
							<li class="x7-partnerHome-li" style="border-bottom:1px solid #ddd">
								<div id="team_list" class="item-link item-content" >
									<!--<div class="item-inner">-->
									<a href="/myTeam?id={{item.id}}&level_name={{item.level_name}}" class="item-inner">
										<div class="item-title">
											<div class="x7-partnerHome-name" style="width: 60%;">{{item.real_name}}</div>								
											<div class="x7-partnerHome-phone">{{item.school_name}}{{item.college_name}}{{item.major_name}}{{item.grade}}级{{item.class}}班</div>
										</div>										
									</a>
									<div class="x7-partnerHome-select" id="{{item.id}}" style="margin-top: -5px;">
									      产品销量
									</div>
								</div>
							</li>
							<div class="list-block" id="id_{{item.id}}" style="margin: 0; display: none;">
						      <ul style="padding-left: 0px;">
						      	{{#each item.goods}}
						        <li class="item-content" style="padding-left: 15px; min-height: 20px; color: orange;">
						          <div class="item-inner" style="min-height: 20px !important;font-size: 14px; padding-bottom: 0px; padding-top: 0px;">
						            <div class="item-title">{{name}}:{{buy_number}}</div>
						          </div>
						        </li>
						        {{/each}}
						      </ul>
						    </div>
						{{/each}}
						</ul>
				</div>
				{{/if}}

			</div>
		</div>
	</div>

	<div class="x7-partnerHome-goodsList">
		<div class="x7-partnerHome-subtitle x7-partnerHome-soldGoods">
			<span class="x7-partnerHome-left">在售商品</span>
			<a href="/soldGoods" class="x7-partnerHome-right">查看更多</a>
		</div>
		{{#each item in goodsData}}
		<a href="/gDetails/{{item.id}}">
		<div id="isMonitor" class="x7-partnerHome-list">
			<div class="x7-soldGoods-title" style="text-align:left">{{item.name}}</div>
			<div class="x7-soldGoods-content">
				<div class="x7-soldGoods-img">
					<img src="{{item.image.path}}" height="60" width="60">
				</div>
				<div class="x7-soldGoods-inner">
					<div>市场价：{{item.sell_price}}</div>
					<div>
						<span>合伙人价：{{item.partner_price}}</span>
						<span style="float: right !important; color:#4caf50 !important">产品详情</span>
					</div>
					<div>
						<span style="padding-right: 80px;">销量：{{item.buy_number}}</span>
						<a href="/soldsSkill/{{item.id}}" style="float: right !important; color:#4caf50 !important">销售攻略</a>
					</div>
				</div>
			</div>
		</div>
		</a>
		{{/each}}
	</div>

	<div class="contacts-content" style="margin-bottom:70px !important">
		<div class="list-block contacts-block">
			<div class="list-group">
				<div class="x7-partnerHome-subtitle">
					<span class="x7-partnerHome-left">最新提现记录</span>
					<a href="/record" class="x7-partnerHome-right">查看更多</a>
				</div>
				<div class="x7-partnerHome-title">
					<ul>
						{{#each draws}}
						<li class="x7-partnerHome-li" style="border-bottom:1px solid #ddd">
							<div class="item-content">
								<div class="item-inner">
									<div class="item-title">
										<span class="x7-partnerHome-name">金额(元):{{draw_fee}}</span>
										<span class="x7-partnerHome-phone">时间：{{created_at}}</span>
										<span class="x7-partnerHome-phone">状态：{{tstate state}}</span>
									</div>
								</div>
							</div>
						</li>
						{{/each}}
					</ul>
				</div>
			</div>
		</div>
	</div>

</template>
